package org.jeecg.common.modules.wx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.jeecg.common.modules.wx.entity.WxAccount;
import org.jeecg.common.modules.wx.mapper.WxAccountMapper;
import org.jeecg.common.modules.wx.service.IWxAccountService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: wx_account
 * @Author: jeecg-boot
 * @Date: 2020-08-08
 * @Version: V1.0
 */
@Service
public class WxAccountServiceImpl extends ServiceImpl<WxAccountMapper, WxAccount> implements IWxAccountService {

    @Override
    public WxAccount getByAccountId(String accountId) {
        LambdaQueryWrapper<WxAccount> query = Wrappers.lambdaQuery();
        query.eq(WxAccount::getAccountId,accountId.trim());
        return getOne(query);
    }

    @Override
    public WxAccount getByAppid(String appid) {
        LambdaQueryWrapper<WxAccount> query = Wrappers.lambdaQuery();
        query.eq(WxAccount::getAppid,appid);
        return getOne(query);
    }
}
